package com.onelap.bls.tc.activity.bluetooth_le;

import android.content.Intent;

import com.blankj.utilcode.util.AppUtils;

import java.util.UUID;


public class BluetoothLeParams {

    public static String[] intentActions = new String[]{
            ServiceParams.ACTION_GATT_CONNECTED,
            ServiceParams.ACTION_GATT_DISCONNECTED,
            ServiceParams.ACTION_GATT_SERVICES_DISCOVERED,
            ServiceParams.ACTION_DATA_AVAILABLE,
            ServiceParams.EXTRA_DATA,
            ServiceParams.DEVICE_DOES_NOT_SUPPORT_UART,
            Intent.ACTION_BATTERY_CHANGED};

    public static class ServiceParams {
        public final static String ACTION_GATT_CONNECTED = AppUtils.getAppPackageName() + ".ACTION_GATT_CONNECTED";
        public final static String ACTION_GATT_DISCONNECTED = AppUtils.getAppPackageName() + ".ACTION_GATT_DISCONNECTED";
        public final static String ACTION_GATT_SERVICES_DISCOVERED = AppUtils.getAppPackageName() + ".ACTION_GATT_SERVICES_DISCOVERED";
        public final static String ACTION_DATA_AVAILABLE = AppUtils.getAppPackageName() + ".ACTION_DATA_AVAILABLE";
        public final static String EXTRA_DATA = AppUtils.getAppPackageName() + ".EXTRA_DATA";
        public final static String DEVICE_DOES_NOT_SUPPORT_UART = AppUtils.getAppPackageName() + ".DEVICE_DOES_NOT_SUPPORT_UART";
        public static final String EXTRA_BATTERY_LEVEL = AppUtils.getAppPackageName() + ".EXTRA_BATTERY_LEVEL";
        public static final String BROADCAST_BATTERY_LEVEL = AppUtils.getAppPackageName() + ".BROADCAST_BATTERY_LEVEL";
        public final static String ACTION_DATA_BATTERY = AppUtils.getAppPackageName() + ".ACTION_DATA_BATTERY";

        public static final UUID TX_POWER_UUID = UUID.fromString("00001804-0000-1000-8000-00805f9b34fb");
        public static final UUID TX_POWER_LEVEL_UUID = UUID.fromString("00002a07-0000-1000-8000-00805f9b34fb");
        public static final UUID CCCD = UUID.fromString("00002902-0000-1000-8000-00805f9b34fb");
        public static final UUID FIRMWARE_REVISON_UUID = UUID.fromString("00002a26-0000-1000-8000-00805f9b34fb");
        public static final UUID DIS_UUID = UUID.fromString("0000180a-0000-1000-8000-00805f9b34fb");
        public static final UUID RX_SERVICE_UUID = UUID.fromString("6e400001-b5a3-f393-e0a9-e50e24dcca9e");
        public static final UUID RX_CHAR_UUID = UUID.fromString("6e400002-b5a3-f393-e0a9-e50e24dcca9e");
        public static final UUID TX_CHAR_UUID = UUID.fromString("6e400003-b5a3-f393-e0a9-e50e24dcca9e");

        public static final UUID BATTERY_SERVICE_UUID = UUID.fromString("0000180f-0000-1000-8000-00805f9b34fb");
        public static final UUID BATTERY_LEVEL_UUID = UUID.fromString("00002a19-0000-1000-8000-00805f9b34fb");
        public static final UUID BATTERY_Client_Characteristic_Configuration_UUID = UUID.fromString("00002902-0000-1000-8000-00805f9b34fb");

        public static final UUID DEVICE_INFO_SERVICE_UUID = UUID.fromString("0000180a-0000-1000-8000-00805f9b34fb");
        public static final UUID Manufacturer_Name_String_UUID = UUID.fromString("00002a28-0000-1000-8000-00805f9b34fb");
    }

    public static class Params {
        public static final int INTENT_REQUEST_ENABLE_BLUETOOTH = 100;
        public static final int SEARCH_TIME = 10000;     //搜索设备时长
    }

    public class UtilCallbackStatue {
        public final static String STATUS_ServiceConnection_Start = "STATUS_ServiceConnection_Start";//开始搜索设备
        public final static String STATUS_ServiceConnection_Playing = "STATUS_ServiceConnection_Playing";//正在搜索设备
        public final static String STATUS_ServiceConnection_Stop = "STATUS_ServiceConnection_Stop";//结束搜索设备
        public final static String STATUS_LeScanCallback_Device_Find = "STATUS_LeScanCallback_Device_Find";//搜索到设备
        public final static String STATUS_ServiceConnection_ServiceConnected = "STATUS_ServiceConnection_ServiceConnected";//服务连接
        public final static String STATUS_ServiceConnection_ServiceDisconnected = "STATUS_ServiceConnection_ServiceDisconnected";//服务失去连接
        public final static String STATUS_BluetoothDevice_Connecting = "STATUS_BluetoothDevice_Connecting";//蓝牙开始连接
        public final static String STATUS_BluetoothDevice_Connected = "STATUS_BluetoothDevice_Connected";//蓝牙连接完成
        public final static String STATUS_BluetoothDevice_DisConnecting = "STATUS_BluetoothDevice_DisConnecting";//蓝牙开始关闭连接
        public final static String STATUS_BluetoothDevice_DisConnected = "STATUS_BluetoothDevice_DisConnected";//蓝牙关闭连接完成
        public final static String STATUS_BluetoothDevice_Connect_Fail = "STATUS_BluetoothDevice_Connect_Fail";//蓝牙连接失败
        public final static String STATUS_BluetoothDevice_Discovered = "STATUS_BluetoothDevice_Discovered";//当远程服务的列表、远程设备的特征和描述符被更新时调用了回调，即新的服务已经被发现。
        public final static String STATUS_BluetoothDevice_Discovered_Fail = "STATUS_BluetoothDevice_Discovered_Fail";//当远程服务的列表、远程设备的特征和描述符被更新时调用了回调，即新的服务已经被发现。(失败)
        public final static String STATUS_BluetoothDevice_Get_Data = "STATUS_BluetoothDevice_Get_Data";//获取到数据
        public final static String STATUS_BluetoothDevice_Get_Data_Fail = "STATUS_BluetoothDevice_Get_Data";//获取到数据失败
        public final static String STATUS_BluetoothDevice_Get_BatteryData = "STATUS_BluetoothDevice_Get_BatteryData";//获取到电量数据
        public final static String STATUS_BluetoothDevice_Get_VersionData = "STATUS_BluetoothDevice_Get_VersionData";//获取到版本数据


        /*public final static String STATUS_ACTION_GATT_SERVICES_DISCOVERED,//连接服务后发现服务
        public final static String STATUS_ACTION_DATA_AVAILABLE,//连接服务后接收数据
        public final static String STATUS_BROADCAST_RECEIVER//BroadcastReceiver 接收数据*/
    }
}
